import area from './model.js';
var obj = new area;
Page({
  data: {
    sea_class:'sea-be',
    rows: [],
    limit: 0,
    wd:''
  },

  onLoad: function (options) {
    obj.getList(this, this.data.limit);
  },

  //点击搜索按钮函数
  clisearch(){
    this.setData({
      sea_class:'sea-af'
    });
  },
  //搜索函数
  goserch(evt){
    var wd = evt.detail.value;
    if (this.data.wd != wd){
      this.data.wd = wd;
      this.data.limit = 0;
    }
    obj.getList(this, this.data.limit,wd);
  },

  //下拉刷新
  onPullDownRefresh(){
    this.limit = 0;
    obj.getList(this, this.data.limit);
  },

  load(){
    if(this.data.wd != ''){
      obj.getList(this, this.data.limit,this.data.wd);
    }else{
      obj.getList(this, this.data.limit);
    }
  }
})